//路由中只配置链接
const express = require('express');
const router = express.Router();

//引入控制器
const UserController = require("../controller/UserController")
// 获取用户名
//http://localhost:3000/api/user/userlist?page=1&size=10
router.get("/userlist", UserController.UserList)

//用户注册
//http://localhost:3000/api/user/register
router.post("/register", UserController.UserRegister)

// 用户登录
//http://localhost:3000/api/user/login
router.post("/login", UserController.Login)

// 图片验证码
//http://localhost:3000/api/user/captcha
router.get("/captcha", UserController.SvgCaptcha)

// 短信随机验证码
//http://localhost:3000/api/user/sendcode
//post
//phone
router.post("/sendcode", UserController.MessageCode)

//短信登录接口
//post
//http://localhost:3000/api/user/phonelogin
//code
//captcha
//phone
router.post("/phonelogin", UserController.PhoneLogin)

module.exports = router